<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="单据ID" prop="djid">
        <el-input
          v-model="queryParams.djid"
          placeholder="请输入单据ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="客户代码" prop="khdm">
        <el-input
          v-model="queryParams.khdm"
          placeholder="请输入客户代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="客户名称" prop="khmc">
        <el-input
          v-model="queryParams.khmc"
          placeholder="请输入客户名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="客户区域代码" prop="khQydm">
        <el-input
          v-model="queryParams.khQydm"
          placeholder="请输入客户区域代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="客户区域名称" prop="khQymc">
        <el-input
          v-model="queryParams.khQymc"
          placeholder="请输入客户区域名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="客户指定品牌代码" prop="khPpdm">
        <el-input
          v-model="queryParams.khPpdm"
          placeholder="请输入客户指定品牌代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="客户指定品牌名称" prop="khPpmc">
        <el-input
          v-model="queryParams.khPpmc"
          placeholder="请输入客户指定品牌名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="配货仓库代码" prop="ckdm">
        <el-input
          v-model="queryParams.ckdm"
          placeholder="请输入配货仓库代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="配货仓库代码" prop="ckmc">
        <el-input
          v-model="queryParams.ckmc"
          placeholder="请输入配货仓库代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品代码" prop="spdm">
        <el-input
          v-model="queryParams.spdm"
          placeholder="请输入商品代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品名称" prop="spmc">
        <el-input
          v-model="queryParams.spmc"
          placeholder="请输入商品名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="他白色代码" prop="gg1dm">
        <el-input
          v-model="queryParams.gg1dm"
          placeholder="请输入他白色代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="暗色名称" prop="gg1mc">
        <el-input
          v-model="queryParams.gg1mc"
          placeholder="请输入暗色名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="尺码代码" prop="gg2dm">
        <el-input
          v-model="queryParams.gg2dm"
          placeholder="请输入尺码代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="尺码名称" prop="gg2mc">
        <el-input
          v-model="queryParams.gg2mc"
          placeholder="请输入尺码名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品年份" prop="nianfen">
        <el-input
          v-model="queryParams.nianfen"
          placeholder="请输入商品年份"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="大类代码" prop="dldm">
        <el-input
          v-model="queryParams.dldm"
          placeholder="请输入大类代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="大类名称" prop="dlmc">
        <el-input
          v-model="queryParams.dlmc"
          placeholder="请输入大类名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="季节代码" prop="jjdm">
        <el-input
          v-model="queryParams.jjdm"
          placeholder="请输入季节代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="季节名称" prop="jjmc">
        <el-input
          v-model="queryParams.jjmc"
          placeholder="请输入季节名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="品牌代码" prop="ppdm">
        <el-input
          v-model="queryParams.ppdm"
          placeholder="请输入品牌代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="品牌名称" prop="ppmc">
        <el-input
          v-model="queryParams.ppmc"
          placeholder="请输入品牌名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品属性1代码" prop="fjsx1">
        <el-input
          v-model="queryParams.fjsx1"
          placeholder="请输入商品属性1代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品属性1名称" prop="fjsx1mc">
        <el-input
          v-model="queryParams.fjsx1mc"
          placeholder="请输入商品属性1名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品属性2代码" prop="fjsx2">
        <el-input
          v-model="queryParams.fjsx2"
          placeholder="请输入商品属性2代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品属性2名称" prop="fjsx2mc">
        <el-input
          v-model="queryParams.fjsx2mc"
          placeholder="请输入商品属性2名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品属性3代码" prop="fjsx3">
        <el-input
          v-model="queryParams.fjsx3"
          placeholder="请输入商品属性3代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品属性3名称" prop="fjsx3mc">
        <el-input
          v-model="queryParams.fjsx3mc"
          placeholder="请输入商品属性3名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品属性4代码" prop="fjsx4">
        <el-input
          v-model="queryParams.fjsx4"
          placeholder="请输入商品属性4代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品属性4名称" prop="fjsx4mc">
        <el-input
          v-model="queryParams.fjsx4mc"
          placeholder="请输入商品属性4名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品属性5代码" prop="fjsx5">
        <el-input
          v-model="queryParams.fjsx5"
          placeholder="请输入商品属性5代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品属性5名称" prop="fjsx5mc">
        <el-input
          v-model="queryParams.fjsx5mc"
          placeholder="请输入商品属性5名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品属性8代码" prop="fjsx6">
        <el-input
          v-model="queryParams.fjsx6"
          placeholder="请输入商品属性8代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品属性8名称" prop="fjsx6mc">
        <el-input
          v-model="queryParams.fjsx6mc"
          placeholder="请输入商品属性8名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品属性7代码" prop="fjsx7">
        <el-input
          v-model="queryParams.fjsx7"
          placeholder="请输入商品属性7代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品属性7名称" prop="fjsx7mc">
        <el-input
          v-model="queryParams.fjsx7mc"
          placeholder="请输入商品属性7名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品属性8代码" prop="fjsx8">
        <el-input
          v-model="queryParams.fjsx8"
          placeholder="请输入商品属性8代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品属性8名称" prop="fjsx8mc">
        <el-input
          v-model="queryParams.fjsx8mc"
          placeholder="请输入商品属性8名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品属性9代码" prop="fjsx9">
        <el-input
          v-model="queryParams.fjsx9"
          placeholder="请输入商品属性9代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品属性9名称" prop="fjsx9mc">
        <el-input
          v-model="queryParams.fjsx9mc"
          placeholder="请输入商品属性9名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品属性10代码" prop="fjsx10">
        <el-input
          v-model="queryParams.fjsx10"
          placeholder="请输入商品属性10代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品属性10名称" prop="fjsx10mc">
        <el-input
          v-model="queryParams.fjsx10mc"
          placeholder="请输入商品属性10名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品属性11代码" prop="fjsx11">
        <el-input
          v-model="queryParams.fjsx11"
          placeholder="请输入商品属性11代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品属性11名称" prop="fjsx11mc">
        <el-input
          v-model="queryParams.fjsx11mc"
          placeholder="请输入商品属性11名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品属性112代码" prop="fjsx12">
        <el-input
          v-model="queryParams.fjsx12"
          placeholder="请输入商品属性112代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品属性12名称" prop="fjsx12mc">
        <el-input
          v-model="queryParams.fjsx12mc"
          placeholder="请输入商品属性12名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品属性13代码" prop="fjsx13">
        <el-input
          v-model="queryParams.fjsx13"
          placeholder="请输入商品属性13代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品属性13名称" prop="fjsx13mc">
        <el-input
          v-model="queryParams.fjsx13mc"
          placeholder="请输入商品属性13名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品属性14代码" prop="fjsx14">
        <el-input
          v-model="queryParams.fjsx14"
          placeholder="请输入商品属性14代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品属性14名称" prop="fjsx14mc">
        <el-input
          v-model="queryParams.fjsx14mc"
          placeholder="请输入商品属性14名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品属性15代码" prop="fjsx15">
        <el-input
          v-model="queryParams.fjsx15"
          placeholder="请输入商品属性15代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品属性15名称" prop="fjsx15mc">
        <el-input
          v-model="queryParams.fjsx15mc"
          placeholder="请输入商品属性15名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品属性16代码" prop="fjsx16">
        <el-input
          v-model="queryParams.fjsx16"
          placeholder="请输入商品属性16代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品属性16名称" prop="fjsx16mc">
        <el-input
          v-model="queryParams.fjsx16mc"
          placeholder="请输入商品属性16名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:sdphdmx:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['system:sdphdmx:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['system:sdphdmx:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['system:sdphdmx:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="sdphdmxList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="明细ID" align="center" prop="mxid" />
      <el-table-column label="单据ID" align="center" prop="djid" />
      <el-table-column label="客户代码" align="center" prop="khdm" />
      <el-table-column label="客户名称" align="center" prop="khmc" />
      <el-table-column label="客户区域代码" align="center" prop="khQydm" />
      <el-table-column label="客户区域名称" align="center" prop="khQymc" />
      <el-table-column label="客户指定品牌代码" align="center" prop="khPpdm" />
      <el-table-column label="客户指定品牌名称" align="center" prop="khPpmc" />
      <el-table-column label="配货仓库代码" align="center" prop="ckdm" />
      <el-table-column label="配货仓库代码" align="center" prop="ckmc" />
      <el-table-column label="商品代码" align="center" prop="spdm" />
      <el-table-column label="商品名称" align="center" prop="spmc" />
      <el-table-column label="他白色代码" align="center" prop="gg1dm" />
      <el-table-column label="暗色名称" align="center" prop="gg1mc" />
      <el-table-column label="尺码代码" align="center" prop="gg2dm" />
      <el-table-column label="尺码名称" align="center" prop="gg2mc" />
      <el-table-column label="商品年份" align="center" prop="nianfen" />
      <el-table-column label="大类代码" align="center" prop="dldm" />
      <el-table-column label="大类名称" align="center" prop="dlmc" />
      <el-table-column label="季节代码" align="center" prop="jjdm" />
      <el-table-column label="季节名称" align="center" prop="jjmc" />
      <el-table-column label="品牌代码" align="center" prop="ppdm" />
      <el-table-column label="品牌名称" align="center" prop="ppmc" />
      <el-table-column label="商品属性1代码" align="center" prop="fjsx1" />
      <el-table-column label="商品属性1名称" align="center" prop="fjsx1mc" />
      <el-table-column label="商品属性2代码" align="center" prop="fjsx2" />
      <el-table-column label="商品属性2名称" align="center" prop="fjsx2mc" />
      <el-table-column label="商品属性3代码" align="center" prop="fjsx3" />
      <el-table-column label="商品属性3名称" align="center" prop="fjsx3mc" />
      <el-table-column label="商品属性4代码" align="center" prop="fjsx4" />
      <el-table-column label="商品属性4名称" align="center" prop="fjsx4mc" />
      <el-table-column label="商品属性5代码" align="center" prop="fjsx5" />
      <el-table-column label="商品属性5名称" align="center" prop="fjsx5mc" />
      <el-table-column label="商品属性8代码" align="center" prop="fjsx6" />
      <el-table-column label="商品属性8名称" align="center" prop="fjsx6mc" />
      <el-table-column label="商品属性7代码" align="center" prop="fjsx7" />
      <el-table-column label="商品属性7名称" align="center" prop="fjsx7mc" />
      <el-table-column label="商品属性8代码" align="center" prop="fjsx8" />
      <el-table-column label="商品属性8名称" align="center" prop="fjsx8mc" />
      <el-table-column label="商品属性9代码" align="center" prop="fjsx9" />
      <el-table-column label="商品属性9名称" align="center" prop="fjsx9mc" />
      <el-table-column label="商品属性10代码" align="center" prop="fjsx10" />
      <el-table-column label="商品属性10名称" align="center" prop="fjsx10mc" />
      <el-table-column label="商品属性11代码" align="center" prop="fjsx11" />
      <el-table-column label="商品属性11名称" align="center" prop="fjsx11mc" />
      <el-table-column label="商品属性112代码" align="center" prop="fjsx12" />
      <el-table-column label="商品属性12名称" align="center" prop="fjsx12mc" />
      <el-table-column label="商品属性13代码" align="center" prop="fjsx13" />
      <el-table-column label="商品属性13名称" align="center" prop="fjsx13mc" />
      <el-table-column label="商品属性14代码" align="center" prop="fjsx14" />
      <el-table-column label="商品属性14名称" align="center" prop="fjsx14mc" />
      <el-table-column label="商品属性15代码" align="center" prop="fjsx15" />
      <el-table-column label="商品属性15名称" align="center" prop="fjsx15mc" />
      <el-table-column label="商品属性16代码" align="center" prop="fjsx16" />
      <el-table-column label="商品属性16名称" align="center" prop="fjsx16mc" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:sdphdmx:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['system:sdphdmx:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改智能配货明细单对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="单据ID" prop="djid">
          <el-input v-model="form.djid" placeholder="请输入单据ID" />
        </el-form-item>
        <el-form-item label="客户代码" prop="khdm">
          <el-input v-model="form.khdm" placeholder="请输入客户代码" />
        </el-form-item>
        <el-form-item label="客户名称" prop="khmc">
          <el-input v-model="form.khmc" placeholder="请输入客户名称" />
        </el-form-item>
        <el-form-item label="客户区域代码" prop="khQydm">
          <el-input v-model="form.khQydm" placeholder="请输入客户区域代码" />
        </el-form-item>
        <el-form-item label="客户区域名称" prop="khQymc">
          <el-input v-model="form.khQymc" placeholder="请输入客户区域名称" />
        </el-form-item>
        <el-form-item label="客户指定品牌代码" prop="khPpdm">
          <el-input v-model="form.khPpdm" placeholder="请输入客户指定品牌代码" />
        </el-form-item>
        <el-form-item label="客户指定品牌名称" prop="khPpmc">
          <el-input v-model="form.khPpmc" placeholder="请输入客户指定品牌名称" />
        </el-form-item>
        <el-form-item label="配货仓库代码" prop="ckdm">
          <el-input v-model="form.ckdm" placeholder="请输入配货仓库代码" />
        </el-form-item>
        <el-form-item label="配货仓库代码" prop="ckmc">
          <el-input v-model="form.ckmc" placeholder="请输入配货仓库代码" />
        </el-form-item>
        <el-form-item label="商品代码" prop="spdm">
          <el-input v-model="form.spdm" placeholder="请输入商品代码" />
        </el-form-item>
        <el-form-item label="商品名称" prop="spmc">
          <el-input v-model="form.spmc" placeholder="请输入商品名称" />
        </el-form-item>
        <el-form-item label="他白色代码" prop="gg1dm">
          <el-input v-model="form.gg1dm" placeholder="请输入他白色代码" />
        </el-form-item>
        <el-form-item label="暗色名称" prop="gg1mc">
          <el-input v-model="form.gg1mc" placeholder="请输入暗色名称" />
        </el-form-item>
        <el-form-item label="尺码代码" prop="gg2dm">
          <el-input v-model="form.gg2dm" placeholder="请输入尺码代码" />
        </el-form-item>
        <el-form-item label="尺码名称" prop="gg2mc">
          <el-input v-model="form.gg2mc" placeholder="请输入尺码名称" />
        </el-form-item>
        <el-form-item label="商品年份" prop="nianfen">
          <el-input v-model="form.nianfen" placeholder="请输入商品年份" />
        </el-form-item>
        <el-form-item label="大类代码" prop="dldm">
          <el-input v-model="form.dldm" placeholder="请输入大类代码" />
        </el-form-item>
        <el-form-item label="大类名称" prop="dlmc">
          <el-input v-model="form.dlmc" placeholder="请输入大类名称" />
        </el-form-item>
        <el-form-item label="季节代码" prop="jjdm">
          <el-input v-model="form.jjdm" placeholder="请输入季节代码" />
        </el-form-item>
        <el-form-item label="季节名称" prop="jjmc">
          <el-input v-model="form.jjmc" placeholder="请输入季节名称" />
        </el-form-item>
        <el-form-item label="品牌代码" prop="ppdm">
          <el-input v-model="form.ppdm" placeholder="请输入品牌代码" />
        </el-form-item>
        <el-form-item label="品牌名称" prop="ppmc">
          <el-input v-model="form.ppmc" placeholder="请输入品牌名称" />
        </el-form-item>
        <el-form-item label="商品属性1代码" prop="fjsx1">
          <el-input v-model="form.fjsx1" placeholder="请输入商品属性1代码" />
        </el-form-item>
        <el-form-item label="商品属性1名称" prop="fjsx1mc">
          <el-input v-model="form.fjsx1mc" placeholder="请输入商品属性1名称" />
        </el-form-item>
        <el-form-item label="商品属性2代码" prop="fjsx2">
          <el-input v-model="form.fjsx2" placeholder="请输入商品属性2代码" />
        </el-form-item>
        <el-form-item label="商品属性2名称" prop="fjsx2mc">
          <el-input v-model="form.fjsx2mc" placeholder="请输入商品属性2名称" />
        </el-form-item>
        <el-form-item label="商品属性3代码" prop="fjsx3">
          <el-input v-model="form.fjsx3" placeholder="请输入商品属性3代码" />
        </el-form-item>
        <el-form-item label="商品属性3名称" prop="fjsx3mc">
          <el-input v-model="form.fjsx3mc" placeholder="请输入商品属性3名称" />
        </el-form-item>
        <el-form-item label="商品属性4代码" prop="fjsx4">
          <el-input v-model="form.fjsx4" placeholder="请输入商品属性4代码" />
        </el-form-item>
        <el-form-item label="商品属性4名称" prop="fjsx4mc">
          <el-input v-model="form.fjsx4mc" placeholder="请输入商品属性4名称" />
        </el-form-item>
        <el-form-item label="商品属性5代码" prop="fjsx5">
          <el-input v-model="form.fjsx5" placeholder="请输入商品属性5代码" />
        </el-form-item>
        <el-form-item label="商品属性5名称" prop="fjsx5mc">
          <el-input v-model="form.fjsx5mc" placeholder="请输入商品属性5名称" />
        </el-form-item>
        <el-form-item label="商品属性8代码" prop="fjsx6">
          <el-input v-model="form.fjsx6" placeholder="请输入商品属性8代码" />
        </el-form-item>
        <el-form-item label="商品属性8名称" prop="fjsx6mc">
          <el-input v-model="form.fjsx6mc" placeholder="请输入商品属性8名称" />
        </el-form-item>
        <el-form-item label="商品属性7代码" prop="fjsx7">
          <el-input v-model="form.fjsx7" placeholder="请输入商品属性7代码" />
        </el-form-item>
        <el-form-item label="商品属性7名称" prop="fjsx7mc">
          <el-input v-model="form.fjsx7mc" placeholder="请输入商品属性7名称" />
        </el-form-item>
        <el-form-item label="商品属性8代码" prop="fjsx8">
          <el-input v-model="form.fjsx8" placeholder="请输入商品属性8代码" />
        </el-form-item>
        <el-form-item label="商品属性8名称" prop="fjsx8mc">
          <el-input v-model="form.fjsx8mc" placeholder="请输入商品属性8名称" />
        </el-form-item>
        <el-form-item label="商品属性9代码" prop="fjsx9">
          <el-input v-model="form.fjsx9" placeholder="请输入商品属性9代码" />
        </el-form-item>
        <el-form-item label="商品属性9名称" prop="fjsx9mc">
          <el-input v-model="form.fjsx9mc" placeholder="请输入商品属性9名称" />
        </el-form-item>
        <el-form-item label="商品属性10代码" prop="fjsx10">
          <el-input v-model="form.fjsx10" placeholder="请输入商品属性10代码" />
        </el-form-item>
        <el-form-item label="商品属性10名称" prop="fjsx10mc">
          <el-input v-model="form.fjsx10mc" placeholder="请输入商品属性10名称" />
        </el-form-item>
        <el-form-item label="商品属性11代码" prop="fjsx11">
          <el-input v-model="form.fjsx11" placeholder="请输入商品属性11代码" />
        </el-form-item>
        <el-form-item label="商品属性11名称" prop="fjsx11mc">
          <el-input v-model="form.fjsx11mc" placeholder="请输入商品属性11名称" />
        </el-form-item>
        <el-form-item label="商品属性112代码" prop="fjsx12">
          <el-input v-model="form.fjsx12" placeholder="请输入商品属性112代码" />
        </el-form-item>
        <el-form-item label="商品属性12名称" prop="fjsx12mc">
          <el-input v-model="form.fjsx12mc" placeholder="请输入商品属性12名称" />
        </el-form-item>
        <el-form-item label="商品属性13代码" prop="fjsx13">
          <el-input v-model="form.fjsx13" placeholder="请输入商品属性13代码" />
        </el-form-item>
        <el-form-item label="商品属性13名称" prop="fjsx13mc">
          <el-input v-model="form.fjsx13mc" placeholder="请输入商品属性13名称" />
        </el-form-item>
        <el-form-item label="商品属性14代码" prop="fjsx14">
          <el-input v-model="form.fjsx14" placeholder="请输入商品属性14代码" />
        </el-form-item>
        <el-form-item label="商品属性14名称" prop="fjsx14mc">
          <el-input v-model="form.fjsx14mc" placeholder="请输入商品属性14名称" />
        </el-form-item>
        <el-form-item label="商品属性15代码" prop="fjsx15">
          <el-input v-model="form.fjsx15" placeholder="请输入商品属性15代码" />
        </el-form-item>
        <el-form-item label="商品属性15名称" prop="fjsx15mc">
          <el-input v-model="form.fjsx15mc" placeholder="请输入商品属性15名称" />
        </el-form-item>
        <el-form-item label="商品属性16代码" prop="fjsx16">
          <el-input v-model="form.fjsx16" placeholder="请输入商品属性16代码" />
        </el-form-item>
        <el-form-item label="商品属性16名称" prop="fjsx16mc">
          <el-input v-model="form.fjsx16mc" placeholder="请输入商品属性16名称" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listSdphdmx, getSdphdmx, delSdphdmx, addSdphdmx, updateSdphdmx } from "@/api/system/sdphdmx";

export default {
  name: "Sdphdmx",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 智能配货明细单表格数据
      sdphdmxList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        djid: null,
        khdm: null,
        khmc: null,
        khQydm: null,
        khQymc: null,
        khPpdm: null,
        khPpmc: null,
        ckdm: null,
        ckmc: null,
        spdm: null,
        spmc: null,
        gg1dm: null,
        gg1mc: null,
        gg2dm: null,
        gg2mc: null,
        nianfen: null,
        dldm: null,
        dlmc: null,
        jjdm: null,
        jjmc: null,
        ppdm: null,
        ppmc: null,
        fjsx1: null,
        fjsx1mc: null,
        fjsx2: null,
        fjsx2mc: null,
        fjsx3: null,
        fjsx3mc: null,
        fjsx4: null,
        fjsx4mc: null,
        fjsx5: null,
        fjsx5mc: null,
        fjsx6: null,
        fjsx6mc: null,
        fjsx7: null,
        fjsx7mc: null,
        fjsx8: null,
        fjsx8mc: null,
        fjsx9: null,
        fjsx9mc: null,
        fjsx10: null,
        fjsx10mc: null,
        fjsx11: null,
        fjsx11mc: null,
        fjsx12: null,
        fjsx12mc: null,
        fjsx13: null,
        fjsx13mc: null,
        fjsx14: null,
        fjsx14mc: null,
        fjsx15: null,
        fjsx15mc: null,
        fjsx16: null,
        fjsx16mc: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        djid: [
          { required: true, message: "单据ID不能为空", trigger: "blur" }
        ],
        khdm: [
          { required: true, message: "客户代码不能为空", trigger: "blur" }
        ],
        khmc: [
          { required: true, message: "客户名称不能为空", trigger: "blur" }
        ],
        ckdm: [
          { required: true, message: "配货仓库代码不能为空", trigger: "blur" }
        ],
        ckmc: [
          { required: true, message: "配货仓库代码不能为空", trigger: "blur" }
        ],
        spdm: [
          { required: true, message: "商品代码不能为空", trigger: "blur" }
        ],
        spmc: [
          { required: true, message: "商品名称不能为空", trigger: "blur" }
        ],
        gg1dm: [
          { required: true, message: "他白色代码不能为空", trigger: "blur" }
        ],
        gg1mc: [
          { required: true, message: "暗色名称不能为空", trigger: "blur" }
        ],
        gg2dm: [
          { required: true, message: "尺码代码不能为空", trigger: "blur" }
        ],
        gg2mc: [
          { required: true, message: "尺码名称不能为空", trigger: "blur" }
        ],
        nianfen: [
          { required: true, message: "商品年份不能为空", trigger: "blur" }
        ],
        dldm: [
          { required: true, message: "大类代码不能为空", trigger: "blur" }
        ],
        dlmc: [
          { required: true, message: "大类名称不能为空", trigger: "blur" }
        ],
        jjdm: [
          { required: true, message: "季节代码不能为空", trigger: "blur" }
        ],
        jjmc: [
          { required: true, message: "季节名称不能为空", trigger: "blur" }
        ],
        ppdm: [
          { required: true, message: "品牌代码不能为空", trigger: "blur" }
        ],
        ppmc: [
          { required: true, message: "品牌名称不能为空", trigger: "blur" }
        ],
        fjsx1: [
          { required: true, message: "商品属性1代码不能为空", trigger: "blur" }
        ],
        fjsx2: [
          { required: true, message: "商品属性2代码不能为空", trigger: "blur" }
        ],
        fjsx3: [
          { required: true, message: "商品属性3代码不能为空", trigger: "blur" }
        ],
        fjsx4: [
          { required: true, message: "商品属性4代码不能为空", trigger: "blur" }
        ],
        fjsx5: [
          { required: true, message: "商品属性5代码不能为空", trigger: "blur" }
        ],
        fjsx6: [
          { required: true, message: "商品属性8代码不能为空", trigger: "blur" }
        ],
        fjsx7: [
          { required: true, message: "商品属性7代码不能为空", trigger: "blur" }
        ],
        fjsx8: [
          { required: true, message: "商品属性8代码不能为空", trigger: "blur" }
        ],
        fjsx9: [
          { required: true, message: "商品属性9代码不能为空", trigger: "blur" }
        ],
        fjsx10: [
          { required: true, message: "商品属性10代码不能为空", trigger: "blur" }
        ],
        fjsx11: [
          { required: true, message: "商品属性11代码不能为空", trigger: "blur" }
        ],
        fjsx12: [
          { required: true, message: "商品属性112代码不能为空", trigger: "blur" }
        ],
        fjsx13: [
          { required: true, message: "商品属性13代码不能为空", trigger: "blur" }
        ],
        fjsx14: [
          { required: true, message: "商品属性14代码不能为空", trigger: "blur" }
        ],
        fjsx15: [
          { required: true, message: "商品属性15代码不能为空", trigger: "blur" }
        ],
        fjsx16: [
          { required: true, message: "商品属性16代码不能为空", trigger: "blur" }
        ],
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询智能配货明细单列表 */
    getList() {
      this.loading = true;
      listSdphdmx(this.queryParams).then(response => {
        this.sdphdmxList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        mxid: null,
        djid: null,
        khdm: null,
        khmc: null,
        khQydm: null,
        khQymc: null,
        khPpdm: null,
        khPpmc: null,
        ckdm: null,
        ckmc: null,
        spdm: null,
        spmc: null,
        gg1dm: null,
        gg1mc: null,
        gg2dm: null,
        gg2mc: null,
        nianfen: null,
        dldm: null,
        dlmc: null,
        jjdm: null,
        jjmc: null,
        ppdm: null,
        ppmc: null,
        fjsx1: null,
        fjsx1mc: null,
        fjsx2: null,
        fjsx2mc: null,
        fjsx3: null,
        fjsx3mc: null,
        fjsx4: null,
        fjsx4mc: null,
        fjsx5: null,
        fjsx5mc: null,
        fjsx6: null,
        fjsx6mc: null,
        fjsx7: null,
        fjsx7mc: null,
        fjsx8: null,
        fjsx8mc: null,
        fjsx9: null,
        fjsx9mc: null,
        fjsx10: null,
        fjsx10mc: null,
        fjsx11: null,
        fjsx11mc: null,
        fjsx12: null,
        fjsx12mc: null,
        fjsx13: null,
        fjsx13mc: null,
        fjsx14: null,
        fjsx14mc: null,
        fjsx15: null,
        fjsx15mc: null,
        fjsx16: null,
        fjsx16mc: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.mxid)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加智能配货明细单";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const mxid = row.mxid || this.ids
      getSdphdmx(mxid).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改智能配货明细单";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.mxid != null) {
            updateSdphdmx(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addSdphdmx(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const mxids = row.mxid || this.ids;
      this.$modal.confirm('是否确认删除智能配货明细单编号为"' + mxids + '"的数据项？').then(function() {
        return delSdphdmx(mxids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('system/sdphdmx/export', {
        ...this.queryParams
      }, `sdphdmx_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
